fix(claude-sandbox): close VS Code credential helper leak#338
Merged
gilesknap merged 1 commit intoDiamondLightSource:claude-sandboxfrom Apr 29, 2026
Merged
Conversation
VS Code's Dev Containers extension re-injects a /tmp credential bridge after postStart runs, allowing host GitHub PATs to leak into the container even with VSCODE_GIT_IPC_HANDLE blanked. Fix by: - Use --unset-all (not =) for credential.helper, so the multi-valued entry VS Code writes is actually cleared. - Remove /tmp/vscode-remote-containers-*.js so the bridge cannot answer even if a stale helper survives. - Pin per-host helpers to command -v gh / glab so a stale host path (/usr/local/bin/gh) doesn't fall through to the next helper. - Re-run cleanup on postAttachCommand because VS Code injects after postStartCommand has already finished. Also: - Install just explicitly when add_claude (recipes need it) - Bump glab to 1.93.0 - Add CLAUDE.md describing sandbox boundaries and intentional exposures (NFS-mounted ~/.claude, /workspaces parent bind, --net=host) - Link CLAUDE.md from README
1189553
into
DiamondLightSource:claude-sandbox
3 of 4 checks passed
coretl
reviewed
Apr 29, 2026
Comment on lines
89
to
107
| }{% if install_gh %}, | ||
| // Persist gh auth across container rebuilds with per-repo scoped PAT | ||
| { | ||
| "source": "gh-auth-${localWorkspaceFolderBasename}", | ||
| "target": "/root/.config/gh", | ||
| "type": "volume" | ||
| }{% endif %}{% if install_glab %}, | ||
| // Persist glab auth across container rebuilds (GitLab CLI) | ||
| { | ||
| "source": "glab-auth-${localWorkspaceFolderBasename}", | ||
| "target": "/root/.config/glab-cli", | ||
| "type": "volume" | ||
| }{% endif %}{% if add_claude %}, | ||
| // Mount Claude config from host (settings, memory, skills) | ||
| { | ||
| "source": "${localEnv:HOME}/.claude", | ||
| "target": "/root/.claude", | ||
| "type": "bind" | ||
| }{% endif %} |
Contributor
There was a problem hiding this comment.
Could /root/.config come from /user-terminal-config and be shared that way?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VS Code's Dev Containers extension re-injects a /tmp credential bridge after postStart runs, allowing host GitHub PATs to leak into the container even with VSCODE_GIT_IPC_HANDLE blanked. Fix by:
Also: